/* draw chart js */

$(function() {

	Highcharts.setOptions({
		global: {
			useUTC: false
		}
	});

	LoadHighStock = function($container, title, data) {
		var retSeries;
		$container.highcharts('StockChart', {
			chart: {
				events: {
					load: function() {
						// set up the updating of the chart each second
						var series = this.series[0];
						retSeries = series;
					}
				}
			},
			rangeSelector: {
				buttons: [{
					count: 1,
					type: 'minute',
					text: '1Min'
				},
				{
					count: 5,
					type: 'minute',
					text: '5Min'
				},
				{
					count: 30,
					type: 'minute',
					text: '0.5h'
				},
				{
					type: 'all',
					text: 'All'
				}],
				inputEnabled: false,
				selected: 0
			},
			title: {
				text: title 
			},
			exporting: {
				enabled: false
			},
			series: [{
				name: 'data',
				type: 'spline',
				marker: {
					enabled: true,
					radius: 2
				},
				data: data,
			}],
			/*
			yAxis: {
				min: 0,
				max: 100,
			},
			*/
		});
		return retSeries;
	}

});

